home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / sort2.zip / BVAL.FUN < prev    next >
Text File  |  1993-01-04  |  339b  |  11 lines

  1. function bval(s:string):real;
  2. { coerces a real value from the s argument 'garbage-999.9999e-99garbage' }
  3. { Copyright 1989, by J. W. Rider }
  4. var r:real; code,i,l:integer;
  5. begin if reversed then bval:=-1.7e38 else bval:=1.7e38;
  6. i:=posnum(s,l);
  7. if i<>0 then val(copy(s,i,l),r,code);
  8. if code=0 then bval:=r;
  9. end; { function bval }
  10.  
  11.